# demo05_with.py
# with简化关闭文件
# fr = open('img/01.txt', mode='r')
# fr.close()

with open('img/01.txt', mode='r', encoding='utf-8') as fr:
    print(fr.read(4))